子オブジェクトと名前のリストが設定された新しいモデルを作成します。新しいモデルは、このX3DObjectの子として関連付けられます。
oReturn = X3DObject.AddModel( [Items], [Name] ); |
パラメータ | タイプ | 詳細 |
---|---|---|
Items | XSICollectionまたはX3DObject | X3DObjectCollectionまたは単一のX3DObject |
Name | String | 新しいの名前Model |
NewScene( null, false ); var oRoot = Application.ActiveSceneRoot; var oNull = oRoot.AddNull( "MyNull" ); // Put the Null in a model oRoot.AddModel( oNull, "ModelForNull" ); // Create 3 objects and put them in an XSICollection var oCollection = XSIFactory.CreateActiveXObject( "XSI.Collection" ); oCollection.Add( oRoot.AddNull("AnotherNull") ); oCollection.Add( oRoot.AddPrimitive("Camera") ); oCollection.Add( oRoot.AddGeometry("Sphere", "MeshSurface") ); // Put all of these objects into another Model oRoot.AddModel( oCollection, "ModelForOtherStuff" ); // Create a model with nothing in it oCollection.RemoveAll(); oRoot.AddModel( oCollection, "EmptyModel" ); |
Option Explicit NewScene , false main() sub main() dim oRoot set oRoot = Application.ActiveProject.ActiveScene.Root oRoot.AddModel oRoot.Children, "Sally" WriteModels oRoot end sub function WriteModels( in_obj ) dim list, n, i, mdls set mdls = in_obj.Models(0) n = mdls.Count if n = 0 then exit function end if for i=0 to n-1 Application.LogMessage mdls(i).Name WriteModels mdls(i) next end function ' Expected results: 'INFO : Sally |